import Bus from '@/utils/bus.js';

export default {
	name: 'home',
	data() {
		return {
			tagsList: [], //标签列表
            collapse: false, //是否折叠
		}
	},
	mounted() {
	},
	created() {
		Bus.$on('collapse-content', msg => {
            this.collapse = msg;
        });

        // 只有在标签页列表里的页面才使用keep-alive，即关闭标签之后就不保存到内存中了。
        Bus.$on('tags', msg => {
            let arr = [];
            for (let i = 0, len = msg.length; i < len; i++) {
                msg[i].name && arr.push(msg[i].name);
            }
            this.tagsList = arr;
        });
	},
	components: {
		cHeader: () => //头部
			import('../../components/header/header.vue'),
		cSidebar: () => //左侧菜单
			import('../../components/sidebar/sidebar.vue'),
		cTags: () => //标签
			import('../../components/tags/tags.vue'),
	},
	methods: {
		
	}
}